Skip to content

Conversation

robertky
Copy link
Member

Summary

  • Add composite B-tree indexes for title, release-year, and average-rating cursor sorts.
  • Use direction-matched tuple comparisons and bounded NULL-partition queries so deep keyset pages can seek through the indexes while preserving NULLS LAST ordering.
  • Add PostgreSQL sorting coverage, a guarded deep-paging benchmark, and document performance and seed/storage tradeoffs.

Closes #74

Verification

  • pnpm format:check
  • pnpm lint
  • pnpm typecheck
  • pnpm test (client: 183 passed; server database integration tests were previously run with TEST_DATABASE_URL: 120 passed; this final run without that variable skipped 44 DB-dependent tests)
  • pnpm build
  • git diff --check

@robertky robertky requested a review from a team as a code owner November 13, 2026 11:13
Copy link
Member

@rachelks rachelks left a comment •

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The performance improvements look promising, and the pagination changes seem consistent with the new indexes!

I noticed that issue #74 also asks for MusicBrainz import timings and the size of each index at one million albums. The documentation currently includes seed time and the combined index size, but not these individual measurements.

@robertky robertky force-pushed the fix/74-composite-cursor-indexes branch from 326e220 to c2ccd98 Compare November 14, 2026 16:03
Copy link
Member

@rachelks rachelks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the missing measurements! The MusicBrainz import timing and individual index sizes are now documented, so my previous comment is addressed.

The pagination changes look good, and CI is passing. Approved! 😊

@rachelks rachelks changed the title feat: add composite cursor indexes for #74 feat: #74 add composite cursor indexes Nov 15, 2026
@rachelks rachelks merged commit c4c0318 into main Nov 15, 2026
3 checks passed
@rachelks rachelks deleted the fix/74-composite-cursor-indexes branch November 15, 2026 10:30
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Composite indexes for the sort keys, so cursor paging is O(page)
2 participants